<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>usbpsu: xusbpsu_ch9_dfu.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.gif"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">usbpsu
   </div>
   <div id="projectbrief">Xilinx SDK Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xusbpsu__ch9__dfu_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xusbpsu_ch9_dfu.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file contains the implementation of the DFU specific chapter 9 code for the example. </p>
<pre>
  MODIFICATION HISTORY:</pre><pre>  Ver   Who  Date     Changes
<hr/>

  1.0    vak  30/11/16 Addded DFU support
*</pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:afaba27e93f1b21ad6f35894a763a83a5"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusbpsu__ch9__dfu_8c.html#afaba27e93f1b21ad6f35894a763a83a5">XUsbPsu_Ch9SetupDevDescReply</a> (struct <a class="el" href="struct_x_usb_psu.html">XUsbPsu</a> *InstancePtr, u8 *BufPtr, u32 BufLen)</td></tr>
<tr class="memdesc:afaba27e93f1b21ad6f35894a763a83a5"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function returns the device descriptor for the device.  <a href="#afaba27e93f1b21ad6f35894a763a83a5">More...</a><br /></td></tr>
<tr class="separator:afaba27e93f1b21ad6f35894a763a83a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a963b902f8afa104fdbccf597956687cd"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusbpsu__ch9__dfu_8c.html#a963b902f8afa104fdbccf597956687cd">XUsbPsu_Ch9SetupCfgDescReply</a> (struct <a class="el" href="struct_x_usb_psu.html">XUsbPsu</a> *InstancePtr, u8 *BufPtr, u32 BufLen)</td></tr>
<tr class="memdesc:a963b902f8afa104fdbccf597956687cd"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function returns the configuration descriptor for the device.  <a href="#a963b902f8afa104fdbccf597956687cd">More...</a><br /></td></tr>
<tr class="separator:a963b902f8afa104fdbccf597956687cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7fd68229a6f293ae45e1915f372a4b48"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusbpsu__ch9__dfu_8c.html#a7fd68229a6f293ae45e1915f372a4b48">XUsbPsu_Ch9SetupStrDescReply</a> (struct <a class="el" href="struct_x_usb_psu.html">XUsbPsu</a> *InstancePtr, u8 *BufPtr, u32 BufLen, u8 Index)</td></tr>
<tr class="memdesc:a7fd68229a6f293ae45e1915f372a4b48"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function returns a string descriptor for the given index.  <a href="#a7fd68229a6f293ae45e1915f372a4b48">More...</a><br /></td></tr>
<tr class="separator:a7fd68229a6f293ae45e1915f372a4b48"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8760d0f66a533e6a80a69e46d099cb28"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusbpsu__ch9__dfu_8c.html#a8760d0f66a533e6a80a69e46d099cb28">XUsbPsu_Ch9SetupBosDescReply</a> (u8 *BufPtr, u32 BufLen)</td></tr>
<tr class="memdesc:a8760d0f66a533e6a80a69e46d099cb28"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function returns the BOS descriptor for the device.  <a href="#a8760d0f66a533e6a80a69e46d099cb28">More...</a><br /></td></tr>
<tr class="separator:a8760d0f66a533e6a80a69e46d099cb28"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab96f137dd947249b3418f1270b2f5fa7"><td class="memItemLeft" align="right" valign="top">s32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusbpsu__ch9__dfu_8c.html#ab96f137dd947249b3418f1270b2f5fa7">XUsbPsu_SetConfiguration</a> (struct <a class="el" href="struct_x_usb_psu.html">XUsbPsu</a> *InstancePtr, SetupPacket *Ctrl)</td></tr>
<tr class="memdesc:ab96f137dd947249b3418f1270b2f5fa7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Changes State of Core to USB configured State.  <a href="#ab96f137dd947249b3418f1270b2f5fa7">More...</a><br /></td></tr>
<tr class="separator:ab96f137dd947249b3418f1270b2f5fa7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7715d7d321e7d482cf8dfbc83c26eb1c"><td class="memItemLeft" align="right" valign="top">s32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusbpsu__ch9__dfu_8c.html#a7715d7d321e7d482cf8dfbc83c26eb1c">XUsbPsu_SetConfigurationApp</a> (struct <a class="el" href="struct_x_usb_psu.html">XUsbPsu</a> *InstancePtr, SetupPacket *SetupData)</td></tr>
<tr class="memdesc:a7715d7d321e7d482cf8dfbc83c26eb1c"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is called by Chapter9 handler when SET_CONFIGURATION command is received from Host.  <a href="#a7715d7d321e7d482cf8dfbc83c26eb1c">More...</a><br /></td></tr>
<tr class="separator:a7715d7d321e7d482cf8dfbc83c26eb1c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="a8760d0f66a533e6a80a69e46d099cb28"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8760d0f66a533e6a80a69e46d099cb28">&#9670;&nbsp;</a></span>XUsbPsu_Ch9SetupBosDescReply()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 XUsbPsu_Ch9SetupBosDescReply </td>
          <td>(</td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>BufPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>BufLen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function returns the BOS descriptor for the device. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">BufPtr</td><td>is the pointer to the buffer that is to be filled with the descriptor. </td></tr>
    <tr><td class="paramname">BufLen</td><td>is the size of the provided buffer.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Length of the descriptor in the buffer on success. 0 on error. </dd></dl>

<p class="reference">Referenced by <a class="el" href="xusbpsu__dfu__class_8c.html#a8924e15732c59062d0483b45ee2ee6c7">dfu_init_data()</a>.</p>

</div>
</div>
<a id="a963b902f8afa104fdbccf597956687cd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a963b902f8afa104fdbccf597956687cd">&#9670;&nbsp;</a></span>XUsbPsu_Ch9SetupCfgDescReply()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 XUsbPsu_Ch9SetupCfgDescReply </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="struct_x_usb_psu.html">XUsbPsu</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>BufPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>BufLen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function returns the configuration descriptor for the device. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">BufPtr</td><td>is the pointer to the buffer that is to be filled with the descriptor. </td></tr>
    <tr><td class="paramname">BufLen</td><td>is the size of the provided buffer.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Length of the descriptor in the buffer on success. 0 on error. </dd></dl>

<p class="reference">Referenced by <a class="el" href="xusbpsu__dfu__class_8c.html#a8924e15732c59062d0483b45ee2ee6c7">dfu_init_data()</a>.</p>

</div>
</div>
<a id="afaba27e93f1b21ad6f35894a763a83a5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afaba27e93f1b21ad6f35894a763a83a5">&#9670;&nbsp;</a></span>XUsbPsu_Ch9SetupDevDescReply()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 XUsbPsu_Ch9SetupDevDescReply </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="struct_x_usb_psu.html">XUsbPsu</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>BufPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>BufLen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function returns the device descriptor for the device. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">BufPtr</td><td>is pointer to the buffer that is to be filled with the descriptor. </td></tr>
    <tr><td class="paramname">BufLen</td><td>is the size of the provided buffer.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Length of the descriptor in the buffer on success. 0 on error. </dd></dl>

<p class="reference">Referenced by <a class="el" href="xusbpsu__dfu__class_8c.html#a8924e15732c59062d0483b45ee2ee6c7">dfu_init_data()</a>.</p>

</div>
</div>
<a id="a7fd68229a6f293ae45e1915f372a4b48"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7fd68229a6f293ae45e1915f372a4b48">&#9670;&nbsp;</a></span>XUsbPsu_Ch9SetupStrDescReply()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 XUsbPsu_Ch9SetupStrDescReply </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="struct_x_usb_psu.html">XUsbPsu</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>BufPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>BufLen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Index</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function returns a string descriptor for the given index. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">BufPtr</td><td>is a pointer to the buffer that is to be filled with the descriptor. </td></tr>
    <tr><td class="paramname">BufLen</td><td>is the size of the provided buffer. </td></tr>
    <tr><td class="paramname">Index</td><td>is the index of the string for which the descriptor is requested.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Length of the descriptor in the buffer on success. 0 on error. </dd></dl>

<p class="reference">Referenced by <a class="el" href="xusbpsu__dfu__class_8c.html#a8924e15732c59062d0483b45ee2ee6c7">dfu_init_data()</a>.</p>

</div>
</div>
<a id="ab96f137dd947249b3418f1270b2f5fa7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab96f137dd947249b3418f1270b2f5fa7">&#9670;&nbsp;</a></span>XUsbPsu_SetConfiguration()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">s32 XUsbPsu_SetConfiguration </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="struct_x_usb_psu.html">XUsbPsu</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">SetupPacket *&#160;</td>
          <td class="paramname"><em>Ctrl</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Changes State of Core to USB configured State. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_x_usb_psu.html" title="USB Device Controller representation. ">XUsbPsu</a> instance. </td></tr>
    <tr><td class="paramname">Ctrl</td><td>is a pointer to the Setup packet data.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS else XST_FAILURE</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">Referenced by <a class="el" href="xusbpsu__dfu__class_8c.html#a8924e15732c59062d0483b45ee2ee6c7">dfu_init_data()</a>.</p>

</div>
</div>
<a id="a7715d7d321e7d482cf8dfbc83c26eb1c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7715d7d321e7d482cf8dfbc83c26eb1c">&#9670;&nbsp;</a></span>XUsbPsu_SetConfigurationApp()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">s32 XUsbPsu_SetConfigurationApp </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="struct_x_usb_psu.html">XUsbPsu</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">SetupPacket *&#160;</td>
          <td class="paramname"><em>SetupData</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is called by Chapter9 handler when SET_CONFIGURATION command is received from Host. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is pointer to <a class="el" href="struct_x_usb_psu.html" title="USB Device Controller representation. ">XUsbPsu</a> instance. </td></tr>
    <tr><td class="paramname">SetupData</td><td>is the setup packet received from Host.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if successful,</li>
<li>XST_FAILURE if unsuccessful.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>Non control endpoints must be enabled after SET_CONFIGURATION command since hardware clears all previously enabled endpoints except control endpoints when this command is received. </dd></dl>

<p class="reference">Referenced by <a class="el" href="xusbpsu__dfu__class_8c.html#a8924e15732c59062d0483b45ee2ee6c7">dfu_init_data()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Copyright &copy; 2015 Xilinx Inc. All rights reserved.</li>
  </ul>
</div>
</body>
</html>
